#include <SimpleAmqpClient/SimpleAmqpClient.h>
#include <iostream>

int main() {
    try {
        // 创建连接
        AmqpClient::Channel::ptr_t channel = AmqpClient::Channel::Create("localhost");
        
        // 声明队列
        std::string queue_name = channel->DeclareQueue(
            "test_queue",  // 队列名称
            false,         // passive - 是否被动声明
            false,         // durable - 队列是否持久化
            false,         // exclusive - 是否排他
            false         // auto_delete - 是否自动删除
        );
        
        // 创建消息
        AmqpClient::BasicMessage::ptr_t message = AmqpClient::BasicMessage::Create("Hello, RabbitMQ!");
        
        // 发布消息
        channel->BasicPublish(
            "",           // exchange - 空字符串表示默认交换机
            queue_name,   // routing_key - 路由键
            message       // 消息内容
        );
        
        std::cout << "Message published to queue: " << queue_name << std::endl;
        
    } catch (const std::exception& ex) {
        std::cerr << "Error: " << ex.what() << std::endl;
        return 1;
    }
    
    return 0;
}